/*******************************************************************************************************

Table 3: The main difference-in-differences results


*******************************************************************************************************/

*Set directory path
cd "C:\Users\tsa23\Documents\petitions\replication files"

clear all

*read in our main dataset
use dta/did_rep.dta

*Elminate contrituencies which are not part of case G
drop if ID == 45 //University of Cambridge
drop if ID == 191 //University of Oxford
keep if new == 1 | drummond == . //this keeps all constituencies not on the Drummond list

drop if year==1830 | year==1831 | year==1832

gen treatgroup = 0
replace treatgroup =  1 if new==1 

gen treatinter = treatperiod*treatgroup

collapse ln_petitions petitions treatgroup, by(ID treatperiod treatinter)

label var treatinter "T * A" 
label var treatgroup "T"
label var treatperiod "A"

reg ln_petitions treatinter treatgroup treatperiod, cl(ID)
outreg2 treatinter treatgroup treatperiod using results\table3, nocons replace addt(Constituencies, 135, Treatment, G) asterisk(coef) auto(2) label ctitle(Log (petitions + 1)) keep(treatinter treatgroup treatperiod) se  symbol(**,*,+) tex(frag)


clear all

*read in our main dataset
use dta/did_rep.dta

*Elminate contrituencies which are not part of case L
drop if ID == 45 //University of Cambridge
drop if ID == 191 //University of Oxford
keep if sch_A==1 | sch_B == 1 | drummond!=. //this keeps all constituencies which are on the Drummond list.

drop if year==1830 | year==1831 | year==1832

gen treatgroup = 0
replace treatgroup =  1 if sch_A==1 

gen treatinter = treatperiod*treatgroup

collapse ln_petitions petitions treatgroup, by(ID treatperiod treatinter)

label var treatinter "T * A" 
label var treatgroup "T"
label var treatperiod "A"

reg ln_petitions treatinter treatgroup treatperiod, cl(ID)
outreg2 treatinter treatgroup treatperiod using results\table3, nocons append addt(Constituencies, 120, Treatment, L) asterisk(coef) auto(2) label ctitle(Log (petitions + 1)) keep(treatinter treatgroup treatperiod) se  symbol(**,*,+) tex(frag)



